package com.itheima.homework.homework05;

public class MilkBox extends Thread{
    private boolean flag = false;

    public void put() {
        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("送奶工往奶箱放了1瓶牛奶");
    }

    public void take() {

        System.out.println("我从奶箱里取走了1瓶牛奶并喝了");
    }


    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }
}
